package com.github.plupload;

import java.io.Serializable;
import java.util.Map;

public class Plupload implements Serializable {
	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 7387738524622283917L;
	/** 文件原名 */
	private String name;
	/** 用户上传资料被分解总块数 */
	private int chunks = -1;
	/** 当前块数（从0开始计数） */
	private int chunk = -1;

	public Plupload() {
	}

	public Plupload(Map<String, String[]> parameterMap) {
		this.name = parameterMap.get("name")[0];
		if(parameterMap.containsKey("chunks")){
			this.chunks = Integer.valueOf(parameterMap.get("chunks")[0]);
		}
		if(parameterMap.containsKey("chunk")){
		this.chunk = Integer.valueOf(parameterMap.get("chunk")[0]);
		}
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getChunks() {
		return chunks;
	}

	public void setChunks(int chunks) {
		this.chunks = chunks;
	}

	public int getChunk() {
		return chunk;
	}

	public void setChunk(int chunk) {
		this.chunk = chunk;
	}
}
